import { defineStore } from "pinia";
import { ref } from "vue";

export const useChangDialogStatusStore = defineStore( // 使用导出变量名
  "ChangDialogStatus",
  () => {
    const ChangDialogStatus = ref(0); // 状态相关内容

    const setChangDialogStatus = (newChangDialogStatus) => {
      ChangDialogStatus.value = newChangDialogStatus; // 更新票据
    };

    const removeChangDialogStatus = () => {
      ChangDialogStatus.value = {}; // 移除当前票据
    };

    return { ChangDialogStatus, setChangDialogStatus, removeChangDialogStatus };
  },
  { persist: true }
);
